import React from 'react';
import cookie from "./utils/cookie";
import ReactDOM from 'react-dom';
import {Provider} from "react-redux";
import {createStore} from "redux";
import appReducer from './store/appReducer';
import * as serviceWorker from './serviceWorker';
import BasicRoute from "./router/BasicRoute";

React.Component.prototype.cookie = cookie;

React.PushPage = function (RouterName) {
    React.Component.props.history.push({
        pathname: '/' + RouterName
    })
}


const store = createStore(appReducer);
ReactDOM.render(
    <Provider store={store}>
        <BasicRoute/>
    </Provider>,
    document.getElementById('root')
);


// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister();
